import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.DefaultListModel;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;


public class T_Subscription extends JFrame {

	
	public T_Subscription() {
		
			String test1 = "User 1";
			String test2 = "User 2";
			String test3 = "User 3";
			String test4 = "User 4";
			String test5 = "User 5";
			
			DefaultListModel Subscriptions = new DefaultListModel();
			Subscriptions.addElement(test1);
			Subscriptions.addElement(test2);
			Subscriptions.addElement(test3);
			Subscriptions.addElement(test4);
			Subscriptions.addElement(test5);
		
			JList subList = new JList (Subscriptions);
			subList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
			subList.setLayoutOrientation(JList.VERTICAL_WRAP);
			subList.setVisibleRowCount(-1);
			
			
			
			JScrollPane listScroller = new JScrollPane(subList);
			listScroller.setPreferredSize(new Dimension(300, 450));

			Button unsubscribe = new Button("Unsubscribe");
			unsubscribe.setSize(100, 20);
			
			Button SortByUser = new Button("Sort By User");
			SortByUser.setSize(100, 20);
			
			JTextField newSubscription = new JTextField(15);
			
			Button AddSub = new Button("Subscribe");
			SortByUser.setSize(100, 20);
			
			
			
			Dimension boxSize = new Dimension(300,60);
			
			
			JPanel ButtonBox = new JPanel ();
			ButtonBox.setPreferredSize(boxSize);
			ButtonBox.add(SortByUser);
			ButtonBox.add(unsubscribe);
			ButtonBox.add(newSubscription);
			ButtonBox.add(AddSub);
			
		
			JFrame frame = new JFrame("Subscriptions");
			frame.setSize(350,560);
			frame.setLocation(0, 0);
			frame.setVisible(false);
			frame.setLayout(new FlowLayout());
			frame.add(ButtonBox);
			frame.add(listScroller);
			
			
			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			
			
			
		}
		
		
		
	
			
			
		
		
		
	
		
	}


